<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<script src="${ctx}/assets/js/myjs/sidebar.js"></script>
<div id="sidebar" class="sidebar                  responsive                    ace-save-state">
	<script type="text/javascript">
		try{ace.settings.loadState('sidebar')}catch(e){}
	</script>


	<ul class="nav nav-list">
		<li class="">
			<a href="${ctx }">
				<i class="menu-icon fa fa-tachometer"></i>
				<span class="menu-text"> Dashboard </span>
			</a>
			<b class="arrow"></b>
		</li>

		
		<c:forEach items="${sessionScope['UserSessionInfo'].menuList }" var="menu">
		<li class="${menu.menuCode }">
			<c:choose>
			<c:when test="${menu.hasSubMenu }">
			<a href="${menu.menuUrl }" class="dropdown-toggle">
				<i class="menu-icon ${menu.menuIcon }"></i>
				<span class="menu-text">
					<c:out value="${menu.menuName }"></c:out>
				</span>				
				<b class="arrow fa fa-angle-down"></b>
			</a>
			</c:when>
			<c:otherwise>
			<a href="${menu.menuUrl }">
				<i class="${menu.menuIcon }"></i>
				<span class="menu-text">
					<c:out value="${menu.menuName }"></c:out>
				</span>				
			</a>
			</c:otherwise>
			</c:choose>
			
			<b class="arrow"></b>
				
			<c:if test="${menu.hasSubMenu}">
			<ul class="submenu">
				<c:forEach items="${menu.subMenuList }" var="subMenu">
				<li class="${subMenu.menuCode }">
					<c:choose>
					<c:when test="${subMenu.hasSubMenu }">
					<a href="${subMenu.menuUrl }" class="dropdown-toggle">
						<i class="${subMenu.menuIcon }"></i>
						<span class="menu-text">
							<c:out value="${subMenu.menuName }"></c:out>
						</span>				
						<b class="arrow fa fa-angle-down"></b>
					</a>
					</c:when>
					<c:otherwise>
					<a href="${subMenu.menuUrl }">
						<i class="${subMenu.menuIcon }"></i>
						<span class="menu-text">
							<c:out value="${subMenu.menuName }"></c:out>
						</span>				
					</a>
					</c:otherwise>
					</c:choose>
					
					<b class="arrow"></b>
					<c:if test="${subMenu.hasSubMenu }">
					<ul class="submenu">
						<c:forEach items="${subMenu.subMenuList }" var="subSubMenu">
						<li class="${subSubMenu.menuCode }">
							<a href="${subSubMenu.menuUrl }">
								<i class="menu-icon fa fa-caret-right"></i>
								<c:out value="${subSubMenu.menuName }"></c:out>
							</a>
						</li>
						</c:forEach>
					</ul>
					</c:if>
				</li>
				
				</c:forEach>
			</ul>
			</c:if>
			
		</li>
		</c:forEach>
	</ul><!-- /.nav-list -->

	<div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
		<i id="sidebar-toggle-icon" class="ace-icon fa fa-angle-double-left ace-save-state" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
	</div>
</div>

